-
Notifications
You must be signed in to change notification settings - Fork 2
gh #192 updated the tapo multi power switch changes #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the tapoControl module to support newer Tapo devices and improves the code quality through better null checking and consistent state management. The changes include upgrading dependencies to support new API versions and refactoring power control logic.
- Updated numpy to version >=2.0.0,<2.3.0 and python-kasa to 0.7.7 to support newer device features
- Refactored outlet/state checking to use explicit
is not Nonecomparisons instead of truthy checks - Replaced property accessors (
is_on/is_off) with direct_is_onattribute usage for consistency - Enhanced power monitoring to support multi-outlet devices with updated API calls
Reviewed Changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| requirements.txt | Updated numpy, python-kasa, and typing_extensions to newer versions |
| framework/core/powerModules/tapoControl.py | Refactored state management, outlet checking, added support for Children device type, and updated power monitoring implementation |
Comments suppressed due to low confidence (2)
framework/core/powerModules/tapoControl.py:187
- The
_performCommandmethod doesn't accept anoArgsparameter. According to the method signature at line 84, it only acceptscommand,json, andappend_argsparameters. This will cause a TypeError at runtime.
result = self._performCommand("state", noArgs=True)
framework/core/powerModules/tapoControl.py:203
- The attribute
self.slotIndexis referenced but never defined in the class. This will raise an AttributeError at runtime. It appears this should beint(self._outlet)based on the outlet handling elsewhere in the code.
if powerState[self.slotIndex+1] == "OFF":
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
TB-1993
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most of the copilot suggestions are good too
Anbukannadhasan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed review comments
TB-1993
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, ship it!
No description provided.